package com.tcs.reptile.accept.impl;

import java.util.Map;

import com.google.common.collect.Maps;
import com.tcs.reptile.accept.PCAccept;
import com.tcs.util.constant.SystemConstants;

/**
 * PC端爬虫参数配置
 */
public class PCAcceptImpl implements PCAccept<Object> {

	@Override
	public Map<String, String> getAccecptHeader(Map<String, String> params) {
		Map<String,String> paramsMap = Maps.newHashMap();
		paramsMap.get(SystemConstants.ReptileConstants.URL).substring(0, paramsMap.get(SystemConstants.ReptileConstants.URL).indexOf("/"));
		String host = paramsMap.get(SystemConstants.ReptileConstants.URL).
				substring(paramsMap.get(SystemConstants.ReptileConstants.URL).indexOf("://") + SystemConstants.ReptileConstants.SUB,
						paramsMap.get(SystemConstants.ReptileConstants.URL).indexOf("com/") + SystemConstants.ReptileConstants.SUB);
		paramsMap.put("Host", host);
		paramsMap.put("Connection", "keep-alive");
		paramsMap.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36");
		paramsMap.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,image/wxpic,image/sharpp,image/apng,*/*;q=0.8");
		paramsMap.put("Accept-Encoding", "gzip, deflate");
		paramsMap.put("Accept-Language", "zh-CN,en-US;q=0.8");
		return paramsMap;
	}
	
	@Override
	public Object getAccecptHeader(Object t) {
		return null;
	}
	
	@Override
	public boolean check() {
		// TODO Auto-generated method stub
		return false;
	}

}
